<?php
    defined('PHPFOX') or exit('NO DICE!'); 
?>

<div id="atarea">
<input type="hidden" name="wall_type" value="blog" />
        <input type="hidden" name="wall_type" value="blog" />
	<div id="atahd">
		<a href="javascript:void(fwall.hdc())" class="ataic wall_close">.</a>
		<div class="wall_blog">Blog</div>
	</div>

<script type="text/javascript">
<!--
{literal}
	function plugin_addFriendToSelectList()
	{
		$('#js_allow_list_input').show();
	}
{/literal}
-->
</script>
<div class="main_break">
	{$sCreateJs}
<!--	<form method="post" action="{url link="wall.blog-submit"}" id="core_js_blog_form" onsubmit="{$sGetJsForm}">-->
		<div><input type="hidden" name="val[attachment]" id="js_attachment" value="{value type='input' id='attachment'}" /></div>
		<div><input type="hidden" name="val[selected_categories]" id="js_selected_categories" value="{value type='input' id='selected_categories'}" /></div>
		{if $bIsEdit}<div><input type="hidden" name="id" value="{$aForms.blog_id}" /></div>{/if}
		{plugin call='blog.template_controller_add_hidden_form'}

		<div class="table">
			<div class="table_left">
				<label for="title">{required}{phrase var='blog.title'}:</label>
			</div>
			<div class="table_right">
				<input type="text" name="val[title]" value="{value type='input' id='title'}" id="title" size="40" />
			</div>
		</div>

		{plugin call='blog.template_controller_add_textarea_start'}

		<div class="table">
			<div class="table_left">
				<label for="text">{required}{phrase var='blog.post'}:</label>
			</div>
			<div class="table_right">
				{editor id='text'}
			</div>
		</div>

		<div class="table">
			<div class="table_left">
				{phrase var='blog.categories'}:
			</div>
			<div class="table_right">
			{if Phpfox::getUserParam('blog.blog_add_categories')}
				<div class="label_flow_menu">
					<ul>
                                            <li id="1" class="label_flow_menu_active"><a href="javascript:void(fwall.blogpublic(1,'default'))">{phrase var='blog.all'}</a></li>
                                            <li id="2"><a href="javascript:void(fwall.blogpublic(2,'public'));">{phrase var='blog.public'}</a></li>
						<li id="3" class="" id="js_user_personal_categories"><a href="javascript:void(fwall.blogpublic(3,'personal'))">{phrase var='blog.personal'}</a></li>
						<li id="4" class="last"><a href="javascript:void(fwall.blogpublic(4,'used'))">{phrase var='blog.most_used'}</a></li>
					</ul>
					<br class="clear" />
				</div>
			{/if}
				<div class="label_flow label_hover labelFlowContent" style="height:100px;" id="js_category_content">
				{if $bIsEdit}
					{module name='wall.add-category-list' user_id=$aForms.user_id}
				{else}
					{module name='wall.add-category-list'}
				{/if}
				</div>
				{if Phpfox::getUserParam('blog.blog_add_categories') && $bCanEditPersonalData}
				<div class="p_top_15">
					<script type="text/javascript">
					<!--
					{literal}
					function addBlogCategory()
					{
						{/literal}
						if ($('#js_add_category1').val() != '' && $('#js_add_category1').val() != '{phrase var='blog.add_a_new_category' phpfox_squote=true}')
						{literal}
						{
							$('#js_add_category1').ajaxCall('blog.addCategory');
						}
					}
					{/literal}
					-->
					</script>
					<input type="text" name="val[add]" value="{phrase var='blog.add_a_new_category'}" onclick="if(this.value=='{phrase var='blog.add_a_new_category' phpfox_squote=true}')this.value='';" onblur="if(this.value=='')this.value='{phrase var='blog.add_a_new_category' phpfox_squote=true}';" id="js_add_category1" class="v_middle" />
                                        <input type="button" value="{phrase var='blog.add'}" class="button v_middle" onclick="addBlogCategory();"  />
					<span id="js_category_info"></span>
					<div class="extra_info">{phrase var='blog.multiple_categories_with_commas'}</div>
				</div>
				{/if}
			</div>
		</div>
                <div class="table">
			<div class="table_left">
				<label for="password">{phrase var='blog.password_protect_post'}:</label>
			</div>
			<div class="table_right">
				<input type="text" name="val[password]" id="password" value="{value type='input' id='password'}" size="22" maxlength="50" />
			</div>
		</div>
                <div class="table">
			<div class="table_left">
				{phrase var='blog.comments'}:
			</div>
			<div class="table_right label_hover">
				<select name="val[allow_comment]" id="allow_comment">
					<option value="1"{value type="select" id="allow_comment" default="1"}>{phrase var='blog.allow_comments'}</option>
					<option value="2"{value type="select" id="allow_comment" default="2"}>{phrase var='blog.moderate_comments_first'}</option>
					<option value="0"{value type="select" id="allow_comment" default="0"}>{phrase var='blog.no_comments'}</option>
				</select>
			</div>
		</div>
		{if Phpfox::isModule('tag') && Phpfox::getUserParam('tag.can_add_tags_on_blogs')}{module name='tag.add' sType=blog}{/if}
		{if Phpfox::isModule('captcha') && Phpfox::getUserParam('captcha.captcha_on_blog_add')}{module name='captcha.form' sType=blog}{/if}

		{plugin call='blog-template_controller_add_textarea_end'}

		<div class="table_clear">
			<input type="button" name="val[preview]" value="{phrase var='blog.preview'}" class="button" onclick="tb_show('{phrase var='blog.blog_preview' phpfox_squote=true}', $.ajaxBox('blog.preview', 'height=400&amp;width=600&amp;text=' + encodeURIComponent(Editor.getContent())));" />
		</div>

		
<!--	</form>-->

	{if Phpfox::getParam('core.display_required')}
	<div class="table_clear">
		{required} {phrase var='core.required_fields'}
	</div>
	{/if}
</div>
</div>

